-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C#: Fix MSVC dotnet builds failing if running dev_mode
#79351
Conversation
Thanks for contributing to the .NET module! I was planning to fix those ambiguous cref for a while now, but never quite got around to it, so thanks! I appreciate it.
Does CI enable these extended warnings? And are these the only places that cause these warnings? |
CI doesn't inherently enable the warnings, that's still done with |
OK, so you are saying you want to change CI to enable these warnings? If so, I would do so in the same PR where you fix these warnings. Otherwise, it doesn't seem like a very useful change, since there's no guarantee that other unreachable code won't be added in the future. Has this been previously discussed in the dev chat? I feel like I may be missing some context. Sorry if I sound dismissive, I'm just trying to understand the motivation behind these changes. In general, I don't like these But the code looks correct, so if it solves a real issue then I'm fine with it. However, there's no linked issue, and I haven't seen users complain about this warning before, so that's why I was asking. |
I'm surprised this wasn't brought up before, it's been preventing me from enabling that & warnings as errors for .net builds. It could be something unique on my end if it's not happening to others, but I wouldn't know where to ask about it. I'm aware of the Rocket Chat, but I don't know which channel would be best (maybe I'm blind but I don't see a C# channel?) I didn't consider adjusting the current warning system because I'm frankly unsure how that is handled. My only real motivation for the |
There isn't a specific channel for C#. We use the #scripting channel which used to be for all scripting languages (GDScript, C# and VisualScript), but now GDScript has its own dedicated channel. Since there isn't much activity, we decided a dedicated channel for C# wasn't needed (at least for now).
I think it's a good fit for the #buildsystem channel, since it's about building Godot.
I always use |
Thanks for the heads-up on the appropriate channels! Joined the former and asked about this in the latter to see if anyone else has experienced the same For now, I assume that's it's MSVC-specific? I have no clue about the minutia of builds, so I wouldn't have considered that a different build environment would pick up on warnings differently! Regardless, I don't really see much of an issue with the |
Mobile moment |
c94437e
to
4b8e201
Compare
Made adjustments to the Also did two more warn fixes: one in ScriptManagerBridge to fix a possible null reference & one in StringExtensions that changes the |
4b8e201
to
f81784e
Compare
Tested a bit more & found one more case where this wrapper was needed: dotnet builds where I sincerely don't know how nobody else had these issues before; I wish I had something more concrete to point to in that respect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing ToLower
and ToUpper
is technically a breaking change, since it changes behavior from using the current culture to the invariant culture. Depending on where it's used it may be correct, but I feel it warrants a discussion. Therefore my recommendation would be to keep those changes as a separate PR if you don't want to increase the scope of the PR.
I appreciate the fixes but I think it'd be better to keep the changes focused on one thing instead of trying to solve multiple things at once, since that increases the scope of the PR and makes it harder to review. Specially when so many small unrelated things are changed at the same time, not all of the changes may be desired and it makes maintainers hesitant to approve. I think this is why #65532 ended up in limbo, I've been extracting the changes from that PR to smaller PRs.
modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs
Outdated
Show resolved
Hide resolved
That's a very good point! I did say early on I didn't want to alter code functionality, so it'd be best to keep true to that |
f81784e
to
957cbd5
Compare
• Added #else section to mono #ifdef checks in relevant export_plugin scripts
957cbd5
to
897334a
Compare
dev_mode
Given I have another docstring-focused PR with #79239, I migrated the relevant changes over there instead. Now this PR is focused squarely on fixing the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good.
This PR is meant to fix issues with building Godot .NET using MSVC with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can confirm that these warnings do happen and that this does fix them, tho I normally don't use dev_mode for my builds so I hadn't seen these before.
Thanks! |
Added
#else
section to mono#ifdef
checks inexport_plugin
scripts. This not being in place caused compilation to fail when enabling extended warnings & warnings as errors, as otherwise the latter sections would be detected as "unreachable code"